package com.xwm93up.design_pattern.single_responsibility_principle;

import lombok.val;
import org.junit.Test;

/**
 * @Description: desc
 * @Author: xwm93up
 * @Since: 2022/3/14 18:15
 */
public class VideoUserService {
    public void serveGrade(String userType) {
        if ("VIP会员".equals(userType)) {
            System.out.println("VIP会员, 视频1080p蓝光");
        } else if ("普通会员".equals(userType)) {
            System.out.println("普通会员, 视频720p超清");
        } else if ("访客用户".equals(userType)) {
            System.out.println("访客用户, 视频480p高清");
        }
    }

    @Test
    public void test_serveGrade() {
        val service = new VideoUserService();
        service.serveGrade("VIP会员");
        service.serveGrade("普通会员");
        service.serveGrade("访客用户");
    }

    @Test
    public void test_VideoUserService() {
        //访客用户
        final val guestVideoUserService = new GuestVideoUserService();
        guestVideoUserService.definition();
        guestVideoUserService.advertisement();

        // 普通会员
        final val ordinaryVideoUserService = new OrdinaryVideoUserService();
        ordinaryVideoUserService.definition();
        ordinaryVideoUserService.advertisement();

        // VIP...
    }

}
